﻿using HyperWPF.Windows.UseData;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HyperWPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
       UseDataWindow  UseDataWindow=new UseDataWindow();
        public MainWindow()
        {
            InitializeComponent();
        }

        int i;
        private void button_Click(object sender, RoutedEventArgs e)
        {
            new Thread(run).Start(); ;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            UseDataWindow.Show();
        }
        public void run()
        {
            DateTime start = DateTime.Now;
            while (true)
            {
                AllData.MyUseData.SetData(0, 0, i.ToString());
                i++;
                if (i > 10000000)
                {
                    break;
                }
            }
            AllData.MyUseData.SetData(0, 1,(DateTime.Now-start).TotalMilliseconds.ToString());
        }
    }
}